{extend name="mainadmin@layouts/base" /}
{block name="main" }
<header class="header  b-b clearfix">
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <i class="fa fa-ellipsis-v"></i>
                <strong>微信配置</strong>
            </li>
        </ul>

    </div>
</header>
<form class="form-horizontal form-validate form-modal form_vbox" method="post" action="{:url('save')}">
    <section class="vbox">
        <section class="scrollable  wrapper w-f">
            <section class="panel panel-default">
                <div class="widget-body">
                    <div class="form-group ">
                        <label class="control-label">公众号名称：</label>
                        <div class="controls">
                            <input type="text" name="setting[plc_name]" class="input-xlarge" data-rule-required="true"
                                   value="{$setting.plc_name}">
                            <span class="maroon">*</span></div>
                    </div>

                    <div class="form-group">
                        <label class="control-label">AppId：</label>
                        <div class="controls">
                            <input type="text" name="setting[weixin_appid]" class="input-xxlarge"
                                   data-rule-required="true" value="{$setting.weixin_appid}">
                            <span class="maroon">*</span></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label">AppSecret：</label>
                        <div class="controls">
                            <input type="text" name="setting[weixin_appsecret]" class="input-xxlarge"
                                   data-rule-required="true" value="{$setting.weixin_appsecret}">
                            <span class="maroon">*</span></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label">公众号类型：</label>
                        <div class="controls">
                            <select name="setting[weixin_type]" class="input-medium" data-nosearch="true">
                                <option value="订阅号" {$setting[
                                'weixin_type']=='订阅号'?'selected':''} >订阅号</option>
                                <option value="服务号" {$setting[
                                'weixin_type']=='服务号'?'selected':''} >服务号</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label">TOKEN：</label>
                        <div class="controls">
                            <input type="text" name="setting[weixin_token]" class="input-medium"
                                   data-rule-required="true" value="{$setting.weixin_token}">
                            <span class="maroon">*</span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label">接口地址：</label>
                        <div class="controls lh30">
                            {:config('config.host_path')}/index.php/weixin/index/index
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label">公众号二维码：</label>
                        <div class="controls ">
                            <div class="defUpImgBox" data-toggle="uploaderOne">
                                <img src="{$setting.weixin_qrcode|default='__STATIC__/main/img/image.png'}">
                                <input type="hidden"  name="setting[weixin_qrcode]"  value="{$setting.weixin_qrcode}">
                                <div class="tips">点击上传</div>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class=" control-label">微信相关：</label>
                        <div class="controls">
                            <label class="radio-inline">
                                <input name="setting[weixin_is_used]" value="1" {$setting['weixin_is_used']==1?'checked':''}
                                type="radio">使用公众号
                            </label>
                            <label class="radio-inline">
                                <input name="setting[weixin_is_used]" value="0" {$setting['weixin_is_used']==0?'checked':''}
                                type="radio" >不使用公众号
                            </label>
                            <br>
                            <span class="help-line">关闭则微信浏览器打开，不会自动获取openid自动登陆</span>
                        </div>
                    </div>
                </div>
            </section>
        </section>
        <footer class="footer bg-white b-t p-t">
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-1">
                    <button type="submit" class="btn btn-primary js_save_submit" data-loading-text="保存中...">保存</button>
                    <button type="button" class="btn btn-default" data-toggle="back">取消</button>
                </div>
            </div>
        </footer>
    </section>
</form>
{/block}